﻿function Special_Edit_ViewModel() {
    var self = this;
    self.VIUList = ko.observableArray();
    self.removeVIU = function (data) {
        self.VIUList.shift(data);
    }
    self.init = function () {

    }
    self.saveForm = function () {

        app.ajax({
            type: "POST",
            url: '/Special/Save',
            data: $(".form-horizontal").find("textarea,input").serialize(),
            dataType: "json",
            success: function (data) {
                if (data.errors.length > 0) {
                    swal("出错啦！", data.errors, "error");
                } else {
                    window.app.loadUI("/Special/");
                }
            },
            error: function (xmlHttpRequest, textStatus, errorThrown) {
                window.app.message("服务器异常。" + textStatus);
            }
        });
    }
}